#ifndef _SINGLETON_H_
#define _SINGLETON_H_

#include "stdio.h"

template <typename T>
struct singleton
{
public:
	static T* Instance()
	{
		if (obj == NULL)
		{
			obj = new T;
		}
		return obj;
	}
private:
	static T* obj;
};

template<typename T>
T* singleton<T>::obj = NULL;


#endif  ///_SINGLETON_H_


